
package dieci.utils;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author DuckSys
 */
public class Configuration {

    public Configuration(){
        try {
            /**Cargamos el archivo desde la ruta especificada*/
            properties.load(new FileInputStream("/dieci/properties/lang_messages_es.properties"));
            setProperties();
        }
        catch (FileNotFoundException ex) {
            Logger.getLogger(Configuration.class.getName()).log(Level.INFO, null, ex.getMessage());
        }
        catch (IOException ex) {
            Logger.getLogger(Configuration.class.getName()).log(Level.SEVERE, null, ex.getMessage());
        }
 
    }
    
    
    /**
     * Get the value of dataNotSavedWarning
     *
     * @return the value of dataNotSavedWarning
     */
    public String getDataNotSavedWarning()
    {
        return dataNotSavedWarning;
    }

    /**
     * Set the value of dataNotSavedWarning
     *
     * @param dataNotSavedWarning new value of dataNotSavedWarning
     */
    public void setDataNotSavedWarning(String dataNotSavedWarning)
    {
        this.dataNotSavedWarning = dataNotSavedWarning;
    }

    public Properties getProperties()
    {
        return properties;
    }

    public void setProperties(Properties properties)
    {
        this.properties = properties;
    }

    public String getProductNotFoundMessage()
    {
        return productNotFoundMessage;
    }

    public void setProductNotFoundMessage(String noProductFound)
    {
        this.productNotFoundMessage = noProductFound;
    }
    
    private void setProperties()
    {
        setDataNotSavedWarning(properties.getProperty("DATA_NOT_SAVED_WARNING"));
        setProductNotFoundMessage(properties.getProperty("NO_PRODUCT_FOUND"));
    }

    
    private Properties properties = new Properties();
    private String dataNotSavedWarning;
    private String productNotFoundMessage;
}
